{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "6ed5e4ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "from openai import OpenAI\n",
    "from IPython.display import Markdown, display\n",
    "import wikipediaapi\n",
    "from dotenv import load_dotenv\n",
    "load_dotenv(override=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "445f6ec7",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Creating prompts\n",
    "user_prompt = input('Enter the topic you wanna search on Wikipedia')\n",
    "\n",
    "system_prompt = \"\"\"\n",
    "You are a snarkyassistant that analyzes the contents of a wikipedia,\n",
    "and provides a helpfull summary. Respond in markdown. Do not wrap the \n",
    "markdown in a code block - respond just with the markdown.\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "15f6968e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'The Honda Civic (Japanese: ホンダ・シビック, Hepburn: Honda Shibikku) is a series of automobiles manufactured by Honda since 1972. As of 2023, the Civic is positioned between the Honda Fit/City and Honda Accord in Honda\\'s global passenger car line-up. It is one of the best-selling automobiles in history, with over 27 million units sold through 2021.\\nThe first-generation Civic was introduced in July 1972 as a two-door fastback sedan, followed by a three-door hatchback that September. With a 1,169 cc transverse engine and front-wheel drive, the car provided good interior space despite its small overall dimensions. Initially gaining a reputation for being fuel-efficient, reliable and environmentally friendly, later iterations have become known for performance and sportiness, especially the Civic Si, SiR, and Type R versions. It is currently in its eleventh generation, which has been produced since 2021.\\nThe Civic has often been rebadged for international markets, and it served as the basis for the Honda CR-X, the Honda CR-X del Sol, the Concerto, the first generation Prelude, the Civic Shuttle (which later became the Orthia) and the CR-V (which in turn was used as the basis for the Honda FR-V).\\n\\nBackground\\nHonda, after establishing itself as a leading manufacturer of motorcycles during the 1950s, began production of automobiles in 1963. Honda introduced its N360 minicar, compliant with Kei car specifications for the Japanese market, for the 1967 model year. The car had a transverse-mounted front-engine, front-wheel-drive (FF) layout, which would be adopted for the later Honda 1300 (1970) and Civic (1972) models. The Civic gave Honda their first market success competing with manufacturers of standard compact cars, which was a growth segment as sales of kei cars plateaued and waned in the early 1970s.\\nIt was Honda\\'s first model to have an impact in the export market. It became one of the most influential automotive designs of the 1970s, with the Volkswagen Golf (1974), Ford Fiesta (1976), and Fiat Ritmo (1978) showing similarities as transverse-FF, truncated-trapezoidal hatchbacks occupying a size niche between minicars and compact sedans. The Renault 5 was introduced six months before the Honda Civic which appeared later in July. Honda would later expand the Civic\\'s FF-compact design to produce the larger and more upmarket Accord (1976) and Prelude (1978) models. In Japan, the Civic was the first fully modern compact car in the European style, offering a level of prestige never before seen in this class in the market. The Civic quickly inspired Japanese domestic manufacturers to respond in kind, with models like the Mazda Familia AP, Daihatsu Charade, and Mitsubishi Mirage.\\nPreviously a subcompact, since 2000 the Civic has been categorized as a compact car. US EPA guidelines for vehicle size class stipulate a car having combined passenger and cargo room of 110 to 119.9 cubic feet (3,110 to 3,400 L) is considered a mid-size car, and as such the tenth generation Civic sedan is technically a small-end mid-size car, although it still competes in the compact class. In Insurance Bureau of Canada\\'s report on top 10 most stolen vehicles in 2005, 2000 Honda Civic Si 2-door, 1999 Honda Civic Si coupe, 1994 Honda Civic Si 2-door Hatchback, 1995 Honda Civic Si 2-door Hatchback were listed as ranks #1, #2, #5, #8 respectively. The Honda Civic has also consistently been the most popular passenger vehicle in Canada.\\nIn Japan, as customers increasingly shifted to minivans and compact cars like the Fit, production of the non-hybrid Civic ended in August 2010. However, the Civic was reintroduced into the Japanese market with the launch of the tenth-generation model in 2017.\\n\\nFirst generation (1972)\\nThe first-generation Civic was introduced on 11 July 1972, but sold as a 1973 model in Japan. It was equipped with a 1,169 cc (71.3 cu in) four-cylinder water-cooled engine and featured front power disc brakes, reclining vinyl bucket seats, simulated wood trim on the dashboard, as well as optional air conditioning and an AM/FM radio. The Civic was available as a two- or four-door fastback sedan, three- and a five-door hatchback, as well as a five-door station wagon. Because of the 1973 oil crisis, consumer demand for fuel efficient vehicles was high, and because of the engine being able to run on either leaded or unleaded fuel, it gave drivers fuel choice flexibility over other vehicles. The Compound Vortex Controlled Combustion (CVCC) engine debuted in December 1973, with a cylinder head design that allowed for more efficient combustion, and as a result the CVCC system did not require a catalytic converter or unleaded fuel to meet 1975 Environmental Protection Agency emissions standards for hydrocarbons and carbon monoxide. The Civic was joined by a platform expansion of the three-door hatchback, called the Honda Accord in 1976.\\n\\nSecond generation (1979)\\nThe second-generation Civic was introduced in June 1979 as a 1980 model. It was larger, had a more angular shape, and came with increased engine power. All Civic engines now used the CVCC design, which added a third valve per cylinder; this introduced lean-burn swirl technology. This generation was available with a 1,335 cc (\"1300\") engine and with an optional 1,488 cc (\"1500\") version; power outputs varied considerably between Japan, Europe, North America, and other markets. Three transmissions were offered: a four-speed manual (on base models), a five-speed manual, and a two-speed semi-automatic Honda had previously called the \"Hondamatic\". The second generation Civic was offered as a three-door hatchback, a four-door sedan, a five-door hatchback and a five-door wagon.\\n\\nThird generation (1983)\\nThe third-generation Civic was released in September 1983 for the 1984 model year. The separate five-door hatchback and wagon models were merged into a five-door \"shuttle wagon\" or \"wagovan\" sometimes referred to colloquially as a \"breadbox\" because of its appearance, called the Honda Civic Shuttle. An additional two-seat coupe style—labeled CRX—was introduced, noted for its compact dimensions and light weight. The third generation Civic saw the introduction of the long running four-cylinder D series engine including a new 1.5 L (91.5 cu in) CVCC engine producing 57 kW (76 hp). 1984 also saw the release of a high-performance Si model for the Japanese market, featuring upgraded suspension and the 1.6 L (97.6 cu in) double overhead camshaft (DOHC) ZC engine which was rated at 96 kW; 130 hp (130 PS). Si models were offered in the U.S. as a 3-door Civic Si hatchback and the CRX Si variant with a 68 kW (91 hp) single overhead camshaft (SOHC) 12-valve engine with programmed fuel injection. A 4WD configuration with different transmission mounts was introduced for the first time in 1984, and later upgraded in 1987. In the United States it delivered a fuel economy of around 8.4 L/100 km; 34 mpg‑imp (28 mpg‑US) highway. The 4WD system was push-button operated until improved in 1987 when the rear wheels would engage automatically once the front wheels lost traction. This new system was called \"Realtime\" which used a \"viscous coupler\" connecting two propeller shafts between the front and rear axles. The manual transmission featured a synchronized 6th gear, called \"SL\", or \"Super-Low\", which was used for high torque at very low speeds. The \"Realtime\" idea is still utilized to this day but includes technological improvements since the first system. Starting with 1985, Japanese Civics were now exclusive to Honda Primo, with variants sold at Honda Verno and Honda Clio. A four-door version called the Ballade was built, under agreement, by Mercedes-Benz South Africa, models were 1300, 1500, 1500i and 1600i DOHC 1.6 injection.\\n\\nFourth generation (1987)\\nIn September 1987, the fourth-generation Civic was introduced with increased dimensions and a lower hood line. A wide range of models and trim levels were offered for various markets around the world. The most notable of which was the Japanese market SiR (featuring the B16A 1.6-liter DOHC VTEC 4-cylinder engine). All U.S. models featured electronic fuel injection, but carbureted models were still available elsewhere. The fourth-generation saw the introduction of a fully independent rear suspension across the entire model range. In addition, the Honda CRX continued to be part of the Civic family which included the base model, HF and Si model in the U.S.A / four door version called the Ballade was built, under agreement, by Mercedes-Benz South Africa / models were 1500 16V, 1600i 16V and 1600i 16V DOHC. The first 800 cars produced at the then brand new Honda plant in Alliston, Ontario, Canada were SE model cars. These Special Edition models included all white side molding that matched the white body and color matched dual mirrors. In the body molding was a wrap around blue stripe. Each car had interior upgrades as well as a chrome-tipped exhaust.\\n\\nFifth generation (1991)\\nIntroduced in September 1991 for the 1992 model year, the fifth-generation Civic featured increased dimensions, as well as more aerodynamic styling. The wagon variant was now only available in the Japanese market where the previous generation wagon was carried over until 1995. The efficiency of the previous HF model was replaced by the VX hatchback which, with an EPA rating of 48\\u2009/\\u200955 miles per US gallon (4.9\\u2009/\\u20094.3 L/100 km; 58\\u2009/\\u200966 mpg‑imp), was Honda\\'s most fuel efficient model sold at the time. In North America, the Si featured a 1.6-liter SOHC VTEC valve train, whereas the VX featured the VTEC-E. The Japanese Si featured a 1.6-liter DOHC non-VTEC valve train D16A9. Continuing in the sporty tradition of the original Civic SiR, Honda sold several similarly equipped variants of the fifth generation car, still referred to as the Civic SiR, in Japan, Asia and Europe. In South Africa, MBSA (Mercedes Benz of SA) built the Civic as the Ballade only in 4-door sedan. A special model was the 180i with the B18B4, that was fitted to Ballade models. A new body style was introduced with this generation called the Civic Coupé, based from the Civic Ferio sedan, and was sold in North America, Europe and Japan. The fifth-generation remains popular among tuners and racers alike.\\n\\nSixth generation (1995)\\nIntroduced in September 1995 for the 1996 model year, the sixth generation featured updated styling, although less radical than previous redesigns. Suspension and engine options were available along with the first natural gas powered Civic, the GX. In the United States, model year 1996 to 2000 Civics were sold under the CX, DX, EX, EXR, HX, LX, and for Canada, SE, and Si trims; all base models were made with 1.6-liter 4-cylinder engines. The EX-CX are all SOHC (Honda D engine). The CX, DX and LX all have SOHC (D16Y7) 4-cylinder engines; whereas the EX has a 1.6L 16-valve SOHC VTEC (D16Y8) engine producing 127 hp (95 kW), and the HX has a D16Y5 VTEC-E engine producing 115 hp (86 kW). The USDM Si and Canadian SiR came with a 1.6L 16-valve DOHC VTEC (B16A2) engine producing 160 hp (119 kW). The first Civic Si coupe EM1 was introduced in 1999 and was produced until 2000. Europe saw a DOHC 1.6 VTi hatchback and sedan and a DOHC 1.8L engine was available for the Domani related 5-door liftback and estate. In Canada, the Acura EL is based on the Civic, and was replaced by the CSX in 2006.\\n\\nSeventh generation (2000)\\nThe seventh-generation Civic was released in September 2000, for the 2001 model year. While it retained the previous generation\\'s exterior dimensions, interior space was improved in part by using a flat rear floor thus bumping up Civic to a compact car size segment. The front suspension was changed from that of a double wishbone to a MacPherson strut, in order to lower costs, as well as allow more engine bay room for the newly introduced Honda K-series engine. Power was also increased on some trim levels. The four main trim levels were DX, LX, EX and HX. The Civic Coupe was no longer sold in Japan starting with this generation.\\nIn North America, coupe and sedan body styles were available, except for the Si (SiR in Canada) which was offered only as a three-door hatchback. The rest of the world received three- and five-door hatchbacks. The Type R was redesigned as well this time using a more powerful i-VTEC engine and using the three-door hatchback body style. This generation saw Honda introduce their first Civic Hybrid, powered by a 1.3-liter engine.\\n\\nEighth generation (2005)\\nThe eighth-generation Civic was released in September 2005 in the North American market, for the 2006 model year. For the eighth-generation, Honda split the model into two different platforms, one for sedan and coupe, and one for a hatchback designed primarily for the European market using a simpler rear suspension from the Honda Fit and more aggressive and futuristic styling.\\nAlthough the North American and the Asia-Pacific model slightly differ in front and rear styling, they are mechanically identical. The hatchback is available as a three and five-door. Both Si and Type R trim levels continued although the Japanese and European Type R, while sharing the same engine size, are mechanically different. In the United States, an improved, sportier version of the Civic Si 4-door tuned by tuner Mugen was offered, featuring cosmetic alterations and changes to the suspension, wheels, slight exterior differences, and exhaust system. A Canadian-only Acura model received a new nameplate, changing from the Acura EL to the Acura CSX.\\nAs of 2006, a total of 16.5 million Civics had been sold worldwide, with 7.3 million of them in the United States.\\n\\nNinth generation (2011)\\nThe ninth-generation Civic consists of four body styles, which are sedan, coupe, hatchback and station wagon marketed as the Civic Tourer. The latter two make up the European-market Civic range built in the UK, which are evolutions from the eighth-generation hatchback. The hatchback version forms a basis for a Civic Type R (FK2) model, which was released later in 2015.\\nThe production version of the ninth-generation Civic sedan and coupe first went on sale in the U.S. on April 20, 2011, for the 2012 model year. The model was developed during the height of the 2008 financial crisis, which led Honda to believe that consumers specifically in North America would be willing to forego upscale content and quality in new vehicles as long as they were fuel efficient and affordable. Following criticisms regarding quality and refinement, Honda updated the Civic with new exterior and interior improvements in late 2012 for the 2013 model year. The ninth-generation Civic was never introduced in Japan, except the 750-unit limited run Civic Type R sold in 2015.\\nA hybrid version was also available for the sedan model, equipped with a larger 1.5-liter i-VTEC engine that produces 67 kW (90 hp) and 132 N⋅m (97 lb⋅ft) of torque and a lithium-ion battery, fuel economy is 5.3 L/100 km; 53 mpg‑imp (44 mpg‑US) in the combined city and highway EPA test cycle, an improvement of 5.7% was achieved over the previous generation hybrid.\\n\\nTenth generation (2015)\\nBased on an all-new Honda compact global platform, the tenth-generation Civic marked the unification of the Civic range globally. Honda targeted the Civic range at the key U.S. market, resurrecting its once-discarded \"lead-country\" system which calls for developing a model specifically for its main targeted market but selling it in other regions as well. As the result, Honda ceased making a smaller, dedicated version for the European market. Instead, the Swindon plant in UK produced a five-door hatchback version of the globally-marketed Civic for international markets.\\nThe sedan model was first unveiled in the U.S. in September 2015, for the 2016 model year. The tenth-generation Civic features a new fastback exterior design, with the rear C-pillar flowing into the tailgate. The front of the car features a new chrome wing design that flows across the top of the headlamps. Civic body styles include sedan, coupe, five-door hatchback, while performance models include Si trims and Type R models. The hatchback version saw its re-introduction in the North American market for the first time since 2000, along with the first Type R model ever sold in the region, both imported from the UK.\\nThe interior of the new Civic likewise features major design changes. Unlike the split bi-level speedometer and tachometer of its predecessor, tenth-generation Civic consolidates these instruments into an optional \"Driver Information Interface\" incorporating a customizable 180 mm (7 in) LCD screen positioned directly behind the steering wheel and in the driver\\'s line of sight. Several model received instrumentation that consists of a large analog tachometer that surrounds a digital speedometer and other digital displays.\\n\\nEleventh generation (2021)\\nThe eleventh-generation Civic sedan was revealed as a prototype in November 2020. The production version was revealed in June 2021, in both sedan and liftback (marketed as the Civic Hatchback) body styles. North American sales began the same month, followed by Southeast Asia in August, Japan and China in September, and Australia and New Zealand in December. Sales in Pakistan began in March 2022, while European sales began in late 2022. In The liftback , the eleventh-generation Honda Civic arrived in Brazil imported from Thailand. The hatchback body style (marketed as the \"Civic Hatchback\") was unveiled on June 23, 2021. This generation is also the first Civic since the second-generation not to offer a coupe version due to its declining sales. The sedan is not offered in Japan, Europe or Australia following low sales of its predecessor.\\n\\nInternational marketing and platform derivatives\\nWhile the Civic is sold in largely the same form worldwide, differences in the name of the models exist between markets. In Japan, the hatchback Civic is just called \"Civic\" while the sedan model was called the Civic Ferio () during the fifth to seventh generations. The sixth-generation sedan was also sold as the Integra SJ. In Europe and the United States, \"Civic\" generically refers to any model, though in Europe the coupe is branded the \"Civic Coupe\". A four-door station wagon model called the Civic Shuttle (also Civic Pro in Japan) was available from 1984 until 1991 (this brand name would later be revived for the mid-1990s Honda Shuttle people carrier, known in some markets as the Honda Odyssey). In South Africa, the sedan (the only model sold there until the 1996 launch of the sixth generation sedan and hatch) was known as the Ballade.\\nOther models have been built on the Civic platform, including Prelude, Ballade, CR-X, Quint, Concerto, Domani, CR-X Del Sol, Integra, and CR-V.\\nAlso, at various times, the Civic or Civic-derived models have been sold by marques other than Honda – for example, Rover sold the 200, 400 and 45, each of which were Civic-based at some point (first 200s were the second generation Ballade; from 1990 the 200 and 400 were based on the Concerto; the 400 was the 1995 Domani), as was their predecessor, the Triumph Acclaim, based on the first Honda Ballade. The Honda Domani, an upscale model based on the Civic, was sold as the Isuzu Gemini in Japan (1992–2000), and confusingly the 5-door Domani was sold as the Honda Civic (along with the \"real\" hatchback and sedan Civics) in Europe from 1995 to 2000. In Thailand, the sixth generation Civic was available as the four-door Isuzu Vertex. The sixth-generation station wagon was sold as the Honda Orthia, with the Partner as the downmarket commercial variant. The seventh generation minivan model is called the Honda Stream. In Canada, the sixth and seventh generation Civics were mildly redesigned to create the Acura EL until the advent of the eighth-generation Civic, which was used to create the Acura CSX, which was designed in Canada. Honda Japan adopted the CSX styling for the Civic in its home country.\\nThe three-door hatchback body style has been somewhat unpopular in the United States, but has achieved wide acceptance in Canada, as well as popularity in Japan and European markets, helping cement Honda\\'s reputation as a maker of sporty compact models. Starting in 2002, the Civic three-door hatchback has been built exclusively at Honda\\'s manufacturing plant in Swindon, England – previously the five-door Civic/Domani and the Civic Aerodeck (based on the Japanese Orthia) were built in this plant for sale in Europe along with the Japanese Civics. Accordingly, all instances of the current model (left or right hand drive, anywhere in the world) are British-made cars designed with Japanese engineering, except for the US-built two-door coupe and the sedan version built in Brazil for the Latin American market.\\nIn North America, the Civic hatchback was dropped for 2006. The 2006 model year standard Civics for North America are manufactured in Alliston, Ontario, Canada (sedans, coupes and Si Coupes) and East Liberty, Ohio (sedans), while the Hybrid version is manufactured in Japan.\\nIn Brazil, although being considered for local manufacturing since the early 1980s (it was illegal to import cars in Brazil from 1973 until 1990), the Civic wasn\\'t available until 1992, via official importing. In 1997, production of the sixth generation Civic sedan started in the Sumaré (a city near Campinas, in the state of São Paulo) factory. The only differences between the Japanese model and the Brazilian model were a slightly higher ground clearance because of the country\\'s roads and adaptations to make the engine suitable for Brazilian fuel, which contains about 25% ethanol (E25), and the absence of sunroof in the Brazilian sixth generation Civic EX. The seventh generation production started in 2001, displacing the Chevrolet Vectra from the top sales record for the mid-size sedan segment, however it lost that position to the Toyota Corolla the following year. In 2006, the eighth generation was released and regained the sales leadership. Identical to the North American version, it lacks options such as a moonroof, and standard safety equipment like Electronic stability control, and side and curtain airbags which were removed because of a lack of car safety laws in the Mercosur. Furthermore, the Brazilian subsidiary began producing flex-fuel versions for the Civic and the Fit models, capable of running on any blend of fuel (E20 to E25 blend in Brazil) and ethanol up to E100.\\n\\nSafety\\nUnited States\\nThe National Highway Traffic Safety Administration (NHTSA) in the United States has determined frontal crash test ratings of Honda Civics of different model years.\\n\\nThe eighth-generation Civic sedan\\'s crash test performance has been rated highly by both the U.S. government\\'s NHTSA and the Insurance Institute for Highway Safety. The IIHS awarded the Civic sedan with a rating of \"good\" on both frontal and side impact crash tests and lists the Civic as the second-best 2007 small car in overall crashworthiness. The Civic coupe is rated \"acceptable\" in the side impact test.\\nNational Highway Traffic Safety Administration (NHTSA) crash test ratings\\nFrontal impact: \\nSide impact front seat: \\nSide impact rear seat: \\nRollover:\\n\\nAustralia\\nIn Australia, 1984–2005 Civics were assessed in the Used Car Safety Ratings 2006 on their level of occupant protection regardless of size or era.\\n\\n(1984–1987) – \"significantly worse than average\"\\n(1988–1991) – \"average\"\\n(1992–1995) – \"average\"\\n(1996–2000) – \"better than average\"\\n(2001–2005) – \"average\"\\nFrom 2007 onwards, Honda Civics have been assessed and given an ANCAP rating.\\n\\n(2007–2011, 4 door sedan) \\n(2007–2012, Hybrid 4 door sedan) \\n(2012–2016, All gasoline sedan variants) \\n(2012–2017, All hatch variants) \\n(2016–2021, All sedan variants) \\n(2017 onwards, All hatch variants except Type R)\\n\\nModifications and enthusiast community\\nDespite being a modest car, the Civic is popular as a platform for modification and customization by the enthusiast community. Readily available parts and interchangeability allows for easy engine swaps and many other upgrades.\\n\\nAwards\\nHonda Civic EX was International Car of the Year in 2005. From 1972 to 1974, the Civic was awarded Car of the Year Japan. In 1973, the Civic ranked third in the European Car of the Year awards, the highest ranking for a Japanese vehicle at that time. It also was awarded the U.S. Road Test magazine\\'s \"1974 Car of the Year.\" The Civic was the Motor Trend Import Car of the Year for 1980\\nas well as its 2006 Car of the Year. In 2006, the Civic earned the 2007 \"Semperit Irish Car of the Year\" title. In 1996, Automobile Magazine honored the Civic as its Automobile of the Year. The Civic has been on Car and Driver magazine\\'s yearly Ten Best list six times, in 1985, 1988–91, and 1996. The Civic Si was named \"Best New Sport Car\" and the sedan was named \"Best New Economy Car\" in the 2006 Canadian Car of the Year awards. The Civic also won the North American Car of the Year and the North American International Auto Show (NAIAS) Car of the Year awards for 2006. In November 2006, the Civic received the prestigious \"Car of The Year\" award from Brazilian magazine Auto Esporte.\\nThe four-door Civic VXi sedan won the South African Car of the Year award for 2007. Kelley Blue Book named the 2020 Honda Civic the Compact Car Best Buy for the sixth year in a row. In 2022, Honda Civic was chosen as the Scottish Car of the Year.\\n\\nRacing\\nTouring car racing\\nCivics have been used for racing ever since their introduction.\\nCivics contested in the Up to 1300 cc class in the Bathurst 1000 touring car race at Bathurst in Australia each year from 1973 to 1976, with a best placing of second in class in both 1974 and 1976.\\nIn recent years the Civic has been used in a wide variety of racing series, particularly in Japan. It is also used in touring car races in Europe and the United States. The Civic has been used in the UK in endurance series by teams such as Barwell Motorsport and Cartek Motorsport.\\nIn 2002, JAS Motorsport entered the European Touring Car Championship (ETCC) with a Super 2000 spec Civic and was used until restart season of the World Touring Car Championship (WTCC) in 2005.\\nIn December 2005, on the date of the new 2006 Civic Si\\'s launch in the United States, Honda\\'s R&D Engineering Team completed 645 laps in an eighth generation Civic Si coupe (FG2) to place first in the E1 class of the famous \\'25 Hours of Thunderhill\\' marathon race. The drivers on Honda\\'s team were Road & Track journalist Kim Wolfkill, Lee Niffenegger, Chad Gilsinger, Sage Marie, John Sherk, Rich Hays, Andrew Frame, Matt Staal and Car and Driver journalist Tony Swan.\\nStarting in 2006, a Civic won its class in the European Touring Car Cup for six out of seven consecutive years.\\nIn Argentina, a Civic won the 2008 and 2009 TC 2000 Championship.\\n\\nBTCC\\nIn the UK, the Civic has been used in the British Touring Car Championship (BTCC) for several years and is still highly competitive. The Civic Type R made its debut in the 2002 season with the \\'Works\\' team run by Arena Motorsport. Built to BTC-T specifications, it gained the team third in the manufacturers championship. In the same year Synchro Motorsport won the BTCC Production Teams Championship with a pair of Civic Type Rs.\\nThe 2003 season saw the \\'works\\' team Civics secure an impressive second in the manufacturers championship. The 2003 BTCC Production Teams Championship also went to the Civic again, this time in the hands of Barwell Motorsport.\\nSuch was the competitiveness of the Civic in its first two-season, 2004 saw five teams enter Civics, allowing the model to secure second in the manufacturers championship.\\nAlthough manufacturer support from Honda for the BTCC ended in 2005, several teams still found success running the Civic in 2005 and 2006.\\n\\nFor the 2007 BTCC season, Team Halfords ran the new eighth-generation Honda Civics, built to the latest S2000 regulations, for Matt Neal and Gordon Shedden with limited success and continued to use the Civic into the 2008 and 2009 season. In both 2007 and 2008, the Civic allowed the team to finish 3rd in the Teams championship, behind the two manufacturer backed teams.\\nIn 2010, Honda returned to the BTCC as a \\'works\\' team with Team Dynamics using Civics to win the 2010 manufacturers championship.\\nIn 2011, the team returns with its Civic to defend its Team and Manufacturers championship again with the Neal and Shedden pairing.\\nHonda Racing Team swapped to the brand new ninth generation Honda Civic, built fully to NGTC rules, for the 2012 BTCC season. They are the first manufacturer backed team to announce their intention to run fully to the NGTC specification. The drivers continue to be Matt Neal and Gordon Shedden, who are the 2011 and 2012 BTCC driver champions respectively. Andrew Jordan, driving for his family-run Eurotech Racing team, won the BTCC title in 2013 in their NGTC Civic, whilst Honda retained the manufacturer\\'s championship. However, in 2014, Honda were unable to retain their title, which was won instead by MG.\\n\\nWTCC\\nIn 2012, Honda announced plans to enter the World Touring Car Championship (WTCC) with a racer built on the ninth-generation Euro Civic five-door hatchback. The car was powered by a 1.6-litre turbocharged HR412E engine, developed by Honda R&D, with the chassis developed by JAS Motorsport. The car raced in the last three rounds of the 2012 season in Japan, China and Macau before its first full season in 2013. In their first full season in the series, Honda won the 2013 Manufacturers\\' World Championship six races before the end of the season, claiming four wins and 20 podium finishes during the year.\\nAfter the introduction of the new TC1 regulations in 2014, the Civics took numerous race victories and podiums, but were not championship contenders again until 2017. The 2017 season saw the Civic achieve the most pole positions and main race victories, but the team missed out on title success partly because their championship-leading driver Tiago Monteiro was forced to miss the final rounds due to a testing crash caused by a brake failure, while other incidents also hampered their results that season.\\n\\nOthers\\nThe car has also been used in the Japanese Touring Car Championship and won the 2011 Asian Touring Car Series. A Civic was used by Lawson Aschenbach to win the 2010 Michelin Pilot Challenge and the 2011 Pirelli World Challenge. It also competed in both the Touring and Super-production classes of the Russian Touring Car Championship. Tomas Engström entered a Civic into the 2012 Scandinavian Touring Car Championship, winning three rounds. Roberto Colciago won the 2016 Italian Touring Car Championship. M1RA won the teams championship in the 2017 TCR International Series. Josh Files won the 2017 ADAC TCR Germany Touring Car Championship and 2017 TCR Middle East Series. Starting with the 2020 TCR Denmark Touring Car Series, Kasper Jensen won the drivers championship for five consecutive years. A Civic won both the drivers and teams championship in the 2021 and 2023 TCR South America Touring Car Championship. Tony D\\'Alberto won the 2022 TCR Australia Touring Car Series.\\nTeam Kunimitsu finished in second place in the 2024 Super GT Series.\\nIt has also been used in rallying under Group R3 regulations, with Zoltan Bessenyey winning the category in the 2014 European Rally Championship. Civics also won a handful of minor categories in both the Australian Rally Championship and the New Zealand Rally Championship.\\nA Civic Coupe was used in the 2019 FIA World Rallycross Championship, and the 2016 Global RallyCross Championship. A Civic won Division 2 of the FIA European Rallycross Championship in 2007 and 2008.\\nThe Civic holds the lap record for a front-wheel-drive car at the Nürburgring.\\n\\nSales\\nAs of February 2015, 18.5 million Civics had been sold worldwide. With 7.3 million bought in the United States, it has been one of the top sellers in the country and in the neighboring Canada, where it had placed number one for 14 years through 2012. In 2019, the Civic was the second-best-selling car in the United States after the Toyota Camry.\\n\\nNotes\\nReferences\\nExternal links\\n\\nCivic at Honda Worldwide'"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wiki_wiki = wikipediaapi.Wikipedia(\n",
    "    user_agent='MyProjectName (johndoe@example.com)',\n",
    "    language='en',\n",
    "    extract_format=wikipediaapi.ExtractFormat.WIKI\n",
    ")\n",
    "\n",
    "if not user_prompt:\n",
    "    user_prompt = 'Honda Civic'\n",
    "    \n",
    "#  Wikipedia topic fetch\n",
    "p_wiki = wiki_wiki.page(user_prompt)\n",
    "p_wiki.text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "0bc5129c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Prepare messages\n",
    "messages = [\n",
    "    {\"role\": \"system\", \"content\": system_prompt},\n",
    "    {\"role\": \"user\", \"content\": user_prompt}\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "ea0b8c04",
   "metadata": {},
   "outputs": [],
   "source": [
    "GEMINI_BASE_URL = \"https://generativelanguage.googleapis.com/v1beta/openai/\"\n",
    "google_api_key = os.getenv(\"GOOGLE_API_KEY\")\n",
    "\n",
    "# Call the model\n",
    "gemini = OpenAI(base_url=GEMINI_BASE_URL, api_key=google_api_key)\n",
    "response = gemini.chat.completions.create(model=\"gemini-2.5-flash-preview-05-20\", messages=messages)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "a7d7e771",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Ah, the Honda Civic. The automotive equivalent of a reliable pair of sensible shoes – you might not *love* them, but they get you where you need to go, probably for an eternity.\n",
       "\n",
       "This humble chariot, gracing our roads since 1972, is Honda's enduring testament to the power of \"good enough.\" It's the car you buy when you prioritize things like \"starting every morning\" and \"not spending all your money on gas\" over \"making a grand entrance.\"\n",
       "\n",
       "Known for its unwavering reliability (it will outlive your houseplants), fuel economy that makes your wallet sigh in relief, and a practicality that screams \"I have errands to run,\" the Civic is the undisputed champion of the automotive background. Seriously, try not to spot at least five of them on your next drive; it's practically impossible.\n",
       "\n",
       "Of course, we can't forget its second life as the canvas for every aspiring street racer with a wrench and a dream of bolt-on turbochargers. Older Civics are practically a rite of passage for anyone who believes a giant spoiler adds at least 20 horsepower.\n",
       "\n",
       "In essence, the Honda Civic is a masterclass in not being flashy, not being outrageous, and just... *being*. It's reliable, it's efficient, and it's absolutely everywhere. Now, if you'll excuse me, I think I just saw another one drive by."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Step 5: Display the summary\n",
    "display(Markdown(response.choices[0].message.content))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
